#ifndef __DS18B20_H__
#define __DS18B20_H__

#include <reg51.h>

sbit DS18B20_DQ = P3^7;  // 数据线连接引脚

unsigned char DS18B20_Init();

void ds18b20_write_bit(unsigned char bits);
void DS18B20_WriteByte(unsigned char dat);

unsigned char ds18b20_read_bit();
unsigned char DS18B20_ReadByte(void);

unsigned char DS18B20_Reset(void);
void ds18b20_ConvertT();
float DS18B20_GetTemp();
void DS18B20_Delayus(unsigned int us);

#endif